#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include "lv_port_disp.h"
#include "lv_port_indev.h"

#include "App.h"
#include "Common/HAL/HAL.h"

#define LVGL_TICK 10

int main(int argc, char** argv)
{
	lv_init();
	printf("success: lv_init()\n");

	lv_port_disp_init();
	printf("success: lv_port_disp_init()\n");

	lv_port_indev_init();
	printf("success: lv_port_indev_init()\n");

	HAL::HAL_Init();
	printf("success: HAL_Init()\n");

	App_Init();
	printf("success: App_Init()\n");

	while (!lv_port_indev_quit()) {
		lv_port_indev_event_poll();

		lv_tick_inc(LVGL_TICK);
		lv_timer_handler();
		HAL::HAL_Update();
		SDL_Delay(LVGL_TICK);
	}

	App_Uninit();

	return 0;
}